package Reeks5.VanRansbeeck.Kevin.View;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;

public class FoldTimer extends JProgressBar implements ActionListener {
    private GameGUI parent;
    private int waarde;
    private Timer t;
    
    public FoldTimer(GameGUI c) {
        super(0,60);
        waarde = 0;
        setValue(waarde);
        
        parent = c;
        t = new Timer(1000, this);
    }
    
    public void actionPerformed(ActionEvent e) {
        waarde++;
        if(waarde == 60) {
            parent.getSpeler().fold();
            t.stop();
        } else {
            setValue(waarde);
        }
    }
}
